package com.nervenets.web.controller.handler.user.user;

import com.nervenets.web.controller.handler.Handler;
import com.nervenets.web.hibernate.domain.user.User;

import javax.servlet.http.HttpServletRequest;

public class UserCheckInviteCodeHandler extends Handler<UserCheckInviteCodeParams> {
    @Override
    public String handle(UserCheckInviteCodeParams params, HttpServletRequest request) throws Exception {
        final User user = userDao.getUserByCode(params.getCode());
        return successMessage(null != user);
    }

    @Override
    public String result() throws Exception {
        return successMessage(true);
    }
}
